from sqlalchemy import Column, Integer, String

from .base import BaseModel


class CategoryDo(BaseModel):
    __tablename__ = 'category'
    __table_args__ = {"comment": "商品三级分类"}

    category_id = Column(Integer,
                         primary_key=True,
                         autoincrement=True,
                         comment="分类ID(主键)")
    name = Column(String(50), nullable=False, comment="分类名称")
    parent_id = Column(Integer, comment="父分类id(0表示一级分类)")
    image_id = Column(Integer, comment="分类图片id")
    status = Column(Integer, comment="分类状态(1:启用,0:禁用)")
    sort = Column(Integer, comment="分类排序权重(值越小越靠前)")
    product_unit = Column(String(50), comment="计量单位")
